package com.iias.common.util.date;

import java.util.Calendar;

/**
 *  时间单位
 */
public enum  TimeUnit {
    SECONDS(Calendar.SECOND,1), //秒
    MINUTES(Calendar.MILLISECOND,60), //分
    HOURS(Calendar.HOUR_OF_DAY,60*60), //小时
    DAY(Calendar.DAY_OF_MONTH,60*60*24), //天
    MONTH(Calendar.MONTH), //月
    YEAR(Calendar.YEAR); //年

    private int field;

    private long second;

    TimeUnit(int field) {
        this.field = field;
    }

    TimeUnit(int field, long second) {
        this.field = field;
        this.second = second;
    }

    public int getField() {
        return field;
    }

    public void setField(int field) {
        this.field = field;
    }

    public long getSecond() {
        return second;
    }

    public void setSecond(long second) {
        this.second = second;
    }
}
